﻿@model Model.goods

@{
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
    ViewBag.Title = "发布商品";
}
<div style="width:500px;">
    @using (Html.BeginForm("UploadGood", "Admin",FormMethod.Post, new { enctype = "multipart/form-data" }))
    {
        @Html.AntiForgeryToken()

        <div class="form-horizontal">
            <h4>添加商品</h4>
            <hr />
            @Html.ValidationSummary(true, "", new { @class = "text-danger" })
            <div class="form-group">
                @Html.LabelFor(model => model.typeid, "商品类别", htmlAttributes: new { @class = "control-label col-md-2" })
                <div class="col-md-10">
                    @Html.DropDownListFor(model => model.typeid, ViewData["typeid"] as IEnumerable<SelectListItem>)
                    @Html.ValidationMessageFor(model => model.typeid, "", new { @class = "text-danger" })
                </div>
            </div>

            <div class="form-group">
                @Html.LabelFor(model => model.goodName, "商品名称", htmlAttributes: new { @class = "control-label col-md-2" })
                <div class="col-md-10">
                    @Html.EditorFor(model => model.goodName, new { htmlAttributes = new { @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.goodName, "", new { @class = "text-danger" })
                </div>
            </div>

            <div class="form-group">
                @Html.LabelFor(model => model.goodprice, "商品单价", htmlAttributes: new { @class = "control-label col-md-2" })
                <div class="col-md-10">
                    @Html.EditorFor(model => model.goodprice, new { htmlAttributes = new { @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.goodprice, "", new { @class = "text-danger" })
                </div>
            </div>

            <div class="form-group">
                @Html.LabelFor(model => model.goodImage, "商品图片", htmlAttributes: new { @class = "control-label col-md-2"})
                <div class="col-md-10">
                    <input style="border:0px;" type="file" id="goodImage" name="goodImage" value="" />
                    @*@Html.EditorFor(model => model.goodImage, new { htmlAttributes = new { @class = "form-control", disabled = "disabled" } })*@
                    @Html.ValidationMessageFor(model => model.goodImage, "", new { @class = "text-danger" })
                </div>
            </div>

            <div class="form-group">
                @Html.LabelFor(model => model.goodDesc, "商品详情", htmlAttributes: new { @class = "control-label col-md-2" })
                <div class="col-md-10">
                    @Html.EditorFor(model => model.goodDesc, new { htmlAttributes = new { @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.goodDesc, "", new { @class = "text-danger" })
                </div>
            </div>

            @*<div class="form-group">
                    @Html.LabelFor(model => model.nowState, htmlAttributes: new { @class = "control-label col-md-2" })
                    <div class="col-md-10">
                        @Html.EditorFor(model => model.nowState, new { htmlAttributes = new { @class = "form-control" } })
                        @Html.ValidationMessageFor(model => model.nowState, "", new { @class = "text-danger" })
                    </div>
                </div>*@

            <div class="form-group">
                <div class="col-md-offset-2 col-md-10">
                    <input type="submit" value="发  布" class="btn btn-default" />
                </div>
            </div>
        </div>
    }
</div>